import { defineComponent } from 'vue';
import { Popover } from 'ant-design-vue';
import { propTypes } from '/@/utils/propTypes';
import { getSlot } from '/@/utils/helper/tsxHelper';

const HlTooltip = defineComponent({
  name: 'HlTooltip',
  props: {
    title: propTypes.string.def(''),
  },
  setup(props, { slots }) {
    return () => (
      <Popover
        content={props.title}
        placement="bottom"
        overlayClassName="hl-bpmn-tooltip"
        v-slots={{ default: () => getSlot(slots) }}
      />
    );
  },
});

export default HlTooltip;
